<template>
    <footer class="layout-footer text-center bg-[#222c3c] py-[30px]">
        <div class="text-[#fff]">
            <NuxtLink :to="`/about/about`"> 关于我们 </NuxtLink>
            ｜
            <NuxtLink
                :to="{ path: '/agreement', query: { type: 1 } }"
                target="_blank"
            >
                服务协议
            </NuxtLink>
            ｜
            <NuxtLink
                :to="{ path: '/agreement', query: { type: 2 } }"
                target="_blank"
            >
                隐私协议
            </NuxtLink>
            ｜
            <NuxtLink to="/user/center"> 个人中心 </NuxtLink>
        </div>
        <div class="text-[#fff] mt-2">
            <a v-if="footData.icp" :href="footData.icp_url">{{ footData.icp }}</a
            ><a v-if="footData.pcp" class="ml-2" :href="footData.pcp_url">{{ footData.pcp }}</a>
        </div>
    </footer>
</template>
<script lang="ts" setup>
import { reactive, onMounted } from "vue";
import useConfigStore from "@/stores/config";

const footData = reactive({
    icp: "",
    icp_url: "",
    pcp: "",
    pcp_url: "",
});

const setData = async () => {
    const data = useConfigStore().sysConfig.record;
    for (const key in footData) {
        if (data[key] != null && data[key] != undefined) {
            footData[key] = data[key];
        }
    }
};

onMounted(() => {
    setData();
});
</script>
<style lang="scss" scoped></style>
